#!/usr/bin/python3

import psutil
import time

io = psutil.net_io_counters()

sent = io.bytes_sent
recv = io.bytes_recv
while True:
    sent_new = io.bytes_sent
    recv_new = io.bytes_recv
    #print(time_q, sent, recv)
    time.sleep(1)
    time_q = int(time.time())
    def net_bc():
        sent_new = io.bytes_sent - sent
        recv_new = io.bytes_recv - recv
        sent = sent_new
        recv = recv_new
        print(time_q, sent_new, recv_new)

    net_bc()
